package com.jh.microservice.rest.annotation;

import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(method = RequestMethod.OPTIONS) // 如果使用AliasFor不添加源注解，会报错
public @interface OptionsMapping {

    /**
     * 需要重新定义属性才能映射值到@RequestMapping中
     */

    @AliasFor(annotation = RequestMapping.class)
    String name() default "";
}
